package com.github.yeecode.mybatisdemo;

/**
 * @author : wushikai
 * <p>
 * date : 2021-02-09
 */
public class ExceptionDemo {


    public  static  void test1 () {

        int x = 1;
        int y = 0;
        try {

            System.out.println(x/y);

        }catch (Exception e){
            //e.printStackTrace();
            throw new IllegalArgumentException("test1: x=" + x + ",y="+y, e);
        }

    }


    public static void test2 () {
        try {

            test1();

        }catch (Exception e){
            System.out.println("e.getMessage() = " + e.getMessage());
            throw new IllegalStateException("test2", e);

        }

    }

    public static void main(String[] args){
        test2();
    }
}
